package com.cvte.shop.service.rest;

import com.cvte.csb.core.interfaces.vo.RestResponse;
import com.cvte.csb.web.rest.ResponseFactory;
import com.cvte.csb.web.swagger.annonation.ApiVersion;
import com.cvte.csb.web.swagger.annonation.ApiVersionDoc;
import com.cvte.shop.enums.RestResponceEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

/**
 * @author DaiShubo
 * @version 1.0
 * @description 访问资源失败
 * @createTime 2020/7/29 10:25 上午
 * @since 1.7
 *
 **/
@Api(tags = "资源返回结果相关接口")
@RestController
@RequestMapping("/resources")
public class RestResourcesController {

    /**
     * 没有访问资源的权限
     * @param response
     * @return
     */
    @ApiVersionDoc(
            {
                    @ApiVersion(value = 1, desc = "初版")
            }
    )
    @ApiOperation("资源访问没有权限")
    @GetMapping("/forbidden")
    public RestResponse forbidden(HttpServletResponse response){
        return ResponseFactory.getForbiddenResult(RestResponceEnum.RESOURCE_FORBIDDEN.getMessage(),RestResponceEnum.RESOURCE_FORBIDDEN.getCode(),response);
    }
}
